home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / falclib2.lzh / ROUTS / DSPMOD.S < prev    next >
Text File  |  1994-08-21  |  4KB  |  151 lines

  1. *
  2. * DSPMOD.S
  3. *
  4. *    @dsp_play
  5. *
  6. *    Sets interupts and plays some music. Supervisor only.
  7. *    May return to user mode after the procedure.
  8. *
  9. * In    a0.l=Module adr.
  10. *    (destroys a lot)
  11. *
  12. *    @dsp_stop
  13. *
  14. *    Stops playing the music and resets interupts.
  15. *    Supervisor only.
  16. *
  17.  
  18.  
  19. ;DSP MOD replay routine written by bITmASTER of BSW
  20. ;This is source code for Devpack 3
  21.  
  22. iera            equ $fffffa07           ;Interrupt-Enable-Register A
  23. ierb            equ $fffffa09           ;                                                               B
  24. imra            equ $fffffa13
  25. isra            equ $fffffa0f
  26. isrb            equ $fffffa11
  27. tacr            equ $fffffa19
  28. tbcr            equ $fffffa1b
  29. tadr            equ $fffffa1f
  30. tbdr            equ $fffffa21
  31. tccr            equ $fffffa1d
  32. tcdr            equ $fffffa23
  33. aer             equ $fffffa03
  34. STColor         equ $ffff8240
  35. FColor          equ $ffff9800
  36. d_vbl             equ $70
  37. timer_int       equ $0120
  38. timer_c_int     equ $0114
  39.  
  40. ym_select       equ $ffff8800
  41. ym_write        equ $ffff8802
  42. ym_read         equ $ffff8800
  43.  
  44. vbaselow        equ $ffff820d
  45. vbasemid        equ $ffff8203
  46. vbasehigh       equ $ffff8201
  47. vcountlow       equ $ffff8209
  48. vcountmid       equ $ffff8207
  49. vcounthigh      equ $ffff8205
  50. linewid         equ $ffff820f
  51. hscroll         equ $ffff8265
  52.  
  53. keyctl          equ $fffffc00
  54. keybd           equ $fffffc02
  55.  
  56. DspHost         equ $ffffa200
  57. HostIntVec      equ $03fc
  58.  
  59. PCookies        equ $05a0
  60.  
  61. d_hop             equ $ffff8a3a
  62. op              equ $ffff8a3b
  63. line_nr         equ $ffff8a3c
  64. mode            equ $ffff8a3c
  65. skew            equ $ffff8a3d
  66. endmask1        equ $ffff8a28
  67. endmask2        equ $ffff8a2a
  68. endmask3        equ $ffff8a2c
  69. x_count         equ $ffff8a36
  70. y_count         equ $ffff8a38
  71. dest_x_inc      equ $ffff8a2e
  72. dest_y_inc      equ $ffff8a30
  73. dest_adr        equ $ffff8a32
  74. src_x_inc       equ $ffff8a20
  75. src_y_inc       equ $ffff8a22
  76. src_adr         equ $ffff8a24
  77.  
  78. mpx_src         equ $ffff8930
  79. mpx_dst         equ $ffff8932
  80.  
  81.  
  82. @dsp_play    move.l    a0,-(sp)
  83.                 lea     player079,a0
  84.                 bsr     reloziere079
  85.         move.l    (sp)+,a0
  86.                 moveq   #1,d0
  87.                 bsr     player079+28       ;ein
  88.         bsr    init079
  89.         rts
  90.  
  91.  
  92. @dsp_stop    bsr    off079
  93.                 bsr     player079+28+4     ;aus
  94.         rts
  95.  
  96.  
  97. timer_b079:        movem.l d0-a6,-(sp)
  98.                 bsr     player079+28+8
  99.                 movem.l (sp)+,d0-a6
  100.                 bclr    #0,$fffffa0f.w
  101.                 rte
  102.  
  103.  
  104. init079:           lea     SaveArea079,a0
  105.                 move.l  timer_int.w,(a0)+
  106.                 move.b  tbcr.w,(a0)+
  107.                 move.b  tbdr.w,(a0)+
  108.                 move.b  #246,tbdr.w
  109.                 move.b  #7,tbcr.w
  110.                 move.l  #timer_b079,timer_int.w
  111.                 bset    #0,imra.w
  112.                 bset    #0,iera.w
  113.                 rts
  114.  
  115. off079:            bclr    #0,iera.w
  116.                 bclr    #0,imra.w
  117.                 lea     SaveArea079,a0
  118.                 move.l  (a0)+,timer_int.w
  119.                 move.b  (a0)+,tbcr.w
  120.                 move.b  (a0)+,tbdr.w
  121.                 rts
  122.  
  123. reloziere079:      
  124.                 move.l  2(a0),d0        ;Relozieren
  125.                 add.l   6(a0),d0
  126.                 add.l   14(a0),d0
  127.                 adda.l  #$1c,a0
  128.                 move.l  a0,d1
  129.                 movea.l a0,a1
  130.                 movea.l a1,a2
  131.                 adda.l  d0,a1
  132.                 move.l  (a1)+,d0
  133.                 adda.l  d0,a2
  134.                 add.l   d1,(a2)
  135.                 clr.l   d0
  136. L000A:          move.b  (a1)+,d0
  137.                 beq     L000C
  138.                 cmp.b   #1,d0
  139.                 beq     L000B
  140.                 adda.l  d0,a2
  141.                 add.l   d1,(a2)
  142.                 bra     L000A
  143. L000B:          adda.l  #$fe,a2
  144.                 bra     L000A
  145. L000C:          rts
  146.  
  147. player079:         incbin 'DSP.BSW'
  148.         even
  149. SaveArea079:       ds.b 6
  150.         even
  151.